/*    */ package cc.s2m.web.s2mBlog.controller;
/*    */ 
/*    */ import cc.s2m.util.Page;
/*    */ import cc.s2m.web.s2mBlog.controller.base.BaseController;
/*    */ import cc.s2m.web.s2mBlog.service.IArticles;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.stereotype.Controller;
/*    */ import org.springframework.ui.Model;
/*    */ import org.springframework.web.bind.annotation.PathVariable;
/*    */ import org.springframework.web.bind.annotation.RequestMapping;
/*    */ 
/*    */ @Controller
/*    */ public class Index extends BaseController
/*    */ {
/* 20 */   public static int PAGE_NUMBER = 10;
/*    */ 
/*    */   @Autowired
/*    */   private IArticles articlesService;
/*    */ 
/* 26 */   @RequestMapping(value={"/"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*    */   public String index(Model model) { Map map = new HashMap();
/* 27 */     Page pageBean = this.articlesService.getPage(1, PAGE_NUMBER, "/", map);
/* 28 */     model.addAttribute("pageBean", pageBean);
/* 29 */     return "index"; }
/*    */ 
/*    */   @RequestMapping(value={"/page/{page}"}, method={org.springframework.web.bind.annotation.RequestMethod.GET})
/*    */   public String page(Model model, @PathVariable Integer page)
/*    */   {
/* 34 */     if (page == null) page = Integer.valueOf(1);
/* 35 */     Map map = new HashMap();
/* 36 */     Page pageBean = this.articlesService.getPage(page.intValue(), PAGE_NUMBER, "/", map);
/* 37 */     model.addAttribute("pageBean", pageBean);
/* 38 */     return "index";
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\s2mBlog.zip
 * Qualified Name:     s2mBlog-3.0.0.WEB-INF.classes.cc.s2m.web.s2mBlog.controller.Index
 * JD-Core Version:    0.6.1
 */